package com.yf.dxs.wo.config;

import com.yf.dxs.wo.rep.WR;
import com.yf.dxs.wo.rep.WoException;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice
@Slf4j
public class CommonResponse  {

    @ExceptionHandler
    public WR handleException(WoException e){
        log.error("订阅异常",e);
        return WR.error(e.getMessage());
    }


    @ExceptionHandler
    public String handleException(Exception e){
        log.error("普通异常",e);
        return "普通异常";
    }
}
